package hu.rsc.forbiddenwords.client;

import hu.rsc.forbiddenwords.shared.ApplicationDTO;
import hu.rsc.forbiddenwords.shared.ColumnFilterList;
import hu.rsc.forbiddenwords.shared.EntryDTO;
import hu.rsc.forbiddenwords.shared.LanguageDTO;

import java.util.List;

import com.google.gwt.gen2.table.client.TableModelHelper.Request;
import com.google.gwt.gen2.table.client.TableModelHelper.Response;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * The async counterpart of <code>GreetingService</code>.
 */
public interface ForbiddenWordsServiceAsync {
    void filter(String input, AsyncCallback<String> callback) throws IllegalArgumentException;

    void getApplicationCount(ColumnFilterList filters, AsyncCallback<Integer> callback);

    void getApplications(Request request, AsyncCallback<Response<ApplicationDTO>> callback);

    void getEntries(Long application, Request request, ColumnFilterList filters, AsyncCallback<Response<EntryDTO>> callback);

    void getEntriesCount(Long application, ColumnFilterList filters, AsyncCallback<Integer> callback);

    void getLanguageCount(ColumnFilterList filters, AsyncCallback<Integer> callback);

    void getLanguages(AsyncCallback<List<LanguageDTO>> callback);

    void getLanguages(Request request, AsyncCallback<Response<LanguageDTO>> callback);

    void saveApplication(ApplicationDTO app, AsyncCallback<ApplicationDTO> callback) throws IllegalArgumentException;

    void saveEntry(EntryDTO entry, AsyncCallback<EntryDTO> callback) throws IllegalArgumentException;

    void saveLanguage(LanguageDTO lang, AsyncCallback<LanguageDTO> callback) throws IllegalArgumentException;
}
